﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="MakeGuild.aspx.cs" Inherits="_2011DBProject.MakeGuild" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<link rel=StyleSheet HREF='design1.css' type='text/css'>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>새벽 골프</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
            <p align =left>
        <asp:Button ID="btnGoLogout" runat="server" onclick="btnGoLogout_onclick" 
            Text="☜ 로 그 아 웃" Width="150px" />
        <asp:Button ID="btnGoServer" runat="server" onclick="btnGoServer_onclick" 
            Text="☜ 서 버 선 택" Width="150px" />
        <asp:Button ID="btnGoCharacter" runat="server" onclick="btnGoCharacter_onclick" 
            Text="☜ 캐 릭 선 택" Width="150px" />
        <asp:Button ID="btnGoChannel" runat="server" onclick="btnGoChannel_onclick" 
            Text="☜ 채 널 선 택" Width="150px" />
        <asp:Button ID="btnGoMain" runat="server" onclick="btnGoMain_onclick" 
            Text="☜ 메 인 화 면" Width="150px" />
        </p>
            <font color="white" size="5px">서버의 길드 리스트<br />
        </font>
        <br />
        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" BackColor="#DEBA84" 
            BorderColor="#DEBA84" BorderStyle="None" BorderWidth="1px" CellPadding="3" 
            CellSpacing="2" DataKeyNames="GUILD_NAME,SERVER_NO" DataSourceID="sqldsGuild" 
            EmptyDataText="서버에 길드가 없습니다." ForeColor="#ffff99" HorizontalAlign="Center">
            <RowStyle BackColor="#FFF7E7" ForeColor="#8C4510" />
            <Columns>
                <asp:BoundField DataField="GUILD_MASTER_NAME" HeaderText="길드마스터" 
                    SortExpression="GUILD_MASTER_NAME" />
                <asp:BoundField DataField="GUILD_VMASTER_NAME" HeaderText="부길드마스터" 
                    SortExpression="GUILD_VMASTER_NAME" Visible="False" />
                <asp:BoundField DataField="GUILD_NAME" HeaderText="길드이름" ReadOnly="True" 
                    SortExpression="GUILD_NAME" />
                <asp:BoundField DataField="MEMBER_LIMIT" HeaderText="회원수제한" 
                    SortExpression="MEMBER_LIMIT" />
                <asp:BoundField DataField="GUILD_POINT" HeaderText="길드포인트" 
                    SortExpression="GUILD_POINT" />
                <asp:BoundField DataField="GUILD_BENEFIT_NO" HeaderText="길드등급" 
                    SortExpression="GUILD_BENEFIT_NO" />
                <asp:BoundField DataField="GUILD_GRADE" HeaderText="길드등급" 
                    SortExpression="GUILD_GRADE" Visible="False" />
            </Columns>
            <FooterStyle BackColor="#F7DFB5" ForeColor="#8C4510" />
            <PagerStyle ForeColor="#8C4510" HorizontalAlign="Center" />
            <SelectedRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="White" />
            <HeaderStyle BackColor="#A55129" Font-Bold="True" ForeColor="White" />
        </asp:GridView>
        <asp:SqlDataSource ID="sqldsGuild" runat="server" 
            ConflictDetection="CompareAllValues" 
            ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
            DeleteCommand="DELETE FROM &quot;GUILD&quot; WHERE &quot;GUILD_NAME&quot; = :original_GUILD_NAME AND &quot;SERVER_NO&quot; = :original_SERVER_NO AND ((&quot;GUILD_MASTER_NAME&quot; = :original_GUILD_MASTER_NAME) OR (&quot;GUILD_MASTER_NAME&quot; IS NULL AND :original_GUILD_MASTER_NAME IS NULL)) AND ((&quot;GUILD_VMASTER_NAME&quot; = :original_GUILD_VMASTER_NAME) OR (&quot;GUILD_VMASTER_NAME&quot; IS NULL AND :original_GUILD_VMASTER_NAME IS NULL)) AND ((&quot;GUILD_GRADE&quot; = :original_GUILD_GRADE) OR (&quot;GUILD_GRADE&quot; IS NULL AND :original_GUILD_GRADE IS NULL)) AND ((&quot;MEMBER_LIMIT&quot; = :original_MEMBER_LIMIT) OR (&quot;MEMBER_LIMIT&quot; IS NULL AND :original_MEMBER_LIMIT IS NULL)) AND ((&quot;GUILD_POINT&quot; = :original_GUILD_POINT) OR (&quot;GUILD_POINT&quot; IS NULL AND :original_GUILD_POINT IS NULL)) AND &quot;GUILD_BENEFIT_NO&quot; = :original_GUILD_BENEFIT_NO" 
            InsertCommand="INSERT INTO &quot;GUILD&quot; (&quot;GUILD_MASTER_NAME&quot;, &quot;GUILD_VMASTER_NAME&quot;, &quot;GUILD_NAME&quot;, &quot;GUILD_GRADE&quot;, &quot;MEMBER_LIMIT&quot;, &quot;SERVER_NO&quot;, &quot;GUILD_POINT&quot;, &quot;GUILD_BENEFIT_NO&quot;) VALUES (:GUILD_MASTER_NAME, :GUILD_VMASTER_NAME, :GUILD_NAME, :GUILD_GRADE, :MEMBER_LIMIT, :SERVER_NO, :GUILD_POINT, :GUILD_BENEFIT_NO)" 
            OldValuesParameterFormatString="original_{0}" 
            ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" 
            SelectCommand="SELECT &quot;GUILD_MASTER_NAME&quot;, &quot;GUILD_VMASTER_NAME&quot;, &quot;GUILD_NAME&quot;, &quot;GUILD_GRADE&quot;, &quot;MEMBER_LIMIT&quot;, &quot;SERVER_NO&quot;, &quot;GUILD_POINT&quot;, &quot;GUILD_BENEFIT_NO&quot; FROM &quot;GUILD&quot; WHERE (&quot;SERVER_NO&quot; = :SERVER_NO)" 
            UpdateCommand="UPDATE &quot;GUILD&quot; SET &quot;GUILD_MASTER_NAME&quot; = :GUILD_MASTER_NAME, &quot;GUILD_VMASTER_NAME&quot; = :GUILD_VMASTER_NAME, &quot;GUILD_GRADE&quot; = :GUILD_GRADE, &quot;MEMBER_LIMIT&quot; = :MEMBER_LIMIT, &quot;GUILD_POINT&quot; = :GUILD_POINT, &quot;GUILD_BENEFIT_NO&quot; = :GUILD_BENEFIT_NO WHERE &quot;GUILD_NAME&quot; = :original_GUILD_NAME AND &quot;SERVER_NO&quot; = :original_SERVER_NO AND ((&quot;GUILD_MASTER_NAME&quot; = :original_GUILD_MASTER_NAME) OR (&quot;GUILD_MASTER_NAME&quot; IS NULL AND :original_GUILD_MASTER_NAME IS NULL)) AND ((&quot;GUILD_VMASTER_NAME&quot; = :original_GUILD_VMASTER_NAME) OR (&quot;GUILD_VMASTER_NAME&quot; IS NULL AND :original_GUILD_VMASTER_NAME IS NULL)) AND ((&quot;GUILD_GRADE&quot; = :original_GUILD_GRADE) OR (&quot;GUILD_GRADE&quot; IS NULL AND :original_GUILD_GRADE IS NULL)) AND ((&quot;MEMBER_LIMIT&quot; = :original_MEMBER_LIMIT) OR (&quot;MEMBER_LIMIT&quot; IS NULL AND :original_MEMBER_LIMIT IS NULL)) AND ((&quot;GUILD_POINT&quot; = :original_GUILD_POINT) OR (&quot;GUILD_POINT&quot; IS NULL AND :original_GUILD_POINT IS NULL)) AND &quot;GUILD_BENEFIT_NO&quot; = :original_GUILD_BENEFIT_NO">
            <SelectParameters>
                <asp:SessionParameter Name="SERVER_NO" SessionField="SERVER" Type="Decimal" />
            </SelectParameters>
            <DeleteParameters>
                <asp:Parameter Name="original_GUILD_NAME" Type="String" />
                <asp:Parameter Name="original_SERVER_NO" Type="Decimal" />
                <asp:Parameter Name="original_GUILD_MASTER_NAME" Type="String" />
                <asp:Parameter Name="original_GUILD_VMASTER_NAME" Type="String" />
                <asp:Parameter Name="original_GUILD_GRADE" Type="Decimal" />
                <asp:Parameter Name="original_MEMBER_LIMIT" Type="Decimal" />
                <asp:Parameter Name="original_GUILD_POINT" Type="Decimal" />
                <asp:Parameter Name="original_GUILD_BENEFIT_NO" Type="Decimal" />
            </DeleteParameters>
            <InsertParameters>
                <asp:Parameter Name="GUILD_MASTER_NAME" Type="String" />
                <asp:Parameter Name="GUILD_VMASTER_NAME" Type="String" />
                <asp:Parameter Name="GUILD_NAME" Type="String" />
                <asp:Parameter Name="GUILD_GRADE" Type="Decimal" />
                <asp:Parameter Name="MEMBER_LIMIT" Type="Decimal" />
                <asp:Parameter Name="SERVER_NO" Type="Decimal" />
                <asp:Parameter Name="GUILD_POINT" Type="Decimal" />
                <asp:Parameter Name="GUILD_BENEFIT_NO" Type="Decimal" />
            </InsertParameters>
            <UpdateParameters>
                <asp:Parameter Name="GUILD_MASTER_NAME" Type="String" />
                <asp:Parameter Name="GUILD_VMASTER_NAME" Type="String" />
                <asp:Parameter Name="GUILD_GRADE" Type="Decimal" />
                <asp:Parameter Name="MEMBER_LIMIT" Type="Decimal" />
                <asp:Parameter Name="GUILD_POINT" Type="Decimal" />
                <asp:Parameter Name="GUILD_BENEFIT_NO" Type="Decimal" />
                <asp:Parameter Name="original_GUILD_NAME" Type="String" />
                <asp:Parameter Name="original_SERVER_NO" Type="Decimal" />
                <asp:Parameter Name="original_GUILD_MASTER_NAME" Type="String" />
                <asp:Parameter Name="original_GUILD_VMASTER_NAME" Type="String" />
                <asp:Parameter Name="original_GUILD_GRADE" Type="Decimal" />
                <asp:Parameter Name="original_MEMBER_LIMIT" Type="Decimal" />
                <asp:Parameter Name="original_GUILD_POINT" Type="Decimal" />
                <asp:Parameter Name="original_GUILD_BENEFIT_NO" Type="Decimal" />
            </UpdateParameters>
        </asp:SqlDataSource>
        <br />
        <asp:DataList ID="DataList1" runat="server" DataSourceID="SqlDataSource1" Visible="False">
            <ItemTemplate>
                CHARACTER_NAME:
                <asp:Label ID="CHARACTER_NAMELabel" runat="server" 
                    Text='<%# Eval("CHARACTER_NAME") %>' />
                <br />
                GUILD_NAME:
                <asp:Label ID="GUILD_NAMELabel" runat="server" 
                    Text='<%# Eval("GUILD_NAME") %>' />
                <br />
                <br />
            </ItemTemplate>
        </asp:DataList>
        <asp:DataList ID="DataList2" runat="server" DataSourceID="SqlDataSource2" 
                Visible="False">
            <ItemTemplate>
                NG_AMOUNT:
                <asp:Label ID="NG_AMOUNTLabel" runat="server" Text='<%# Eval("NG_AMOUNT") %>' />
                <br />
                <br />
            </ItemTemplate>
        </asp:DataList>
        <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
            ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
            ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" 
            SelectCommand="SELECT &quot;NG_AMOUNT&quot; FROM &quot;CHARACTER&quot; WHERE ((&quot;CHARACTER_NAME&quot; = :CHARACTER_NAME) AND (&quot;SERVER_NO&quot; = :SERVER_NO))">
            <SelectParameters>
                <asp:SessionParameter Name="CHARACTER_NAME" SessionField="CHARACTER_NAME" 
                    Type="String" />
                <asp:SessionParameter Name="SERVER_NO" SessionField="SERVER" Type="Decimal" />
            </SelectParameters>
        </asp:SqlDataSource>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
            ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" SelectCommand="SELECT G.CHARACTER_NAME, G.GUILD_NAME
FROM GUILD_MEMBER G, CHARACTER C
WHERE C.CHARACTER_NAME = G.CHARACTER_NAME and C.ACCOUNT_ID = :ACCOUNT_ID">
            <SelectParameters>
                <asp:SessionParameter DefaultValue="" Name="ACCOUNT_ID" SessionField="USER" />
            </SelectParameters>
        </asp:SqlDataSource>
        <br />
        <br />
        <font color="white" size="5px">길드 생성</font><br />
        <asp:Panel ID="Panel1" runat="server" DefaultButton="btnMakeGuild">
        <table class = "normalTable" align="center">
            <tr>
                <td>길 드 명</td>
                <td>
                    <asp:TextBox ID="txtGuildName" runat="server" Width="216px"></asp:TextBox>
                </td>
            </tr>
            <tr>
            <td colspan=2>
                <asp:Button ID="btnMakeGuild" runat="server" Text="길드 생성" Width="286px" 
                    onclick="btnMakeRoom_Click" Height="37px" />
            </td>
            </tr>
        </table>
        </asp:Panel>
        <br />
            <asp:Label ID="lblEnd" runat="server" Font-Size="Large" ForeColor="#FFFF99" 
                Text="길드를 생성하였습니다!" Font-Bold="True" Visible="False"></asp:Label>
            <br />
            <br />
    <asp:DataList ID="DataListCharacter" runat="server" DataKeyField="CHARACTER_NAME"
 DataSourceID="SqlDataSource3" Height="10px" RepeatColumns="3"
 ShowFooter="False" ShowHeader="False" Visible="False"
 Width="200" style="margin-bottom: 53px" ItemStyle-HorizontalAlign="Right" 
                HorizontalAlign="Center" RepeatLayout="Flow">
<ItemStyle HorizontalAlign="Right"></ItemStyle>
<ItemTemplate>
&nbsp;
<asp:Label ID="CHARACTER_NAMELabel" runat="server" Text='<%# Eval("CHARACTER_NAME") %>' Visible="FALSE" />
<br />
기술:
<asp:Label ID="TECHNIQUELabel" runat="server" Text='<%# Eval("TECHNIQUE") %>' />
<br />
파워:
<asp:Label ID="POWERLabel" runat="server" Text='<%# Eval("POWER") %>' />
<br />
임팩트:
<asp:Label ID="IMPACTLabel" runat="server" Text='<%# Eval("IMPACT") %>' />
<br />
힘:
<asp:Label ID="STRENGTHLabel" runat="server" Text='<%# Eval("STRENGTH") %>' />
<asp:Label ID="LVLLabel" runat="server" Text='<%# Eval("LVL") %>' Visible="FALSE" />
<asp:Label ID="SEXLabel" runat="server" Text='<%# Eval("SEX") %>' Visible="FALSE" />
<br />
핸디캡:
<asp:Label ID="HADICAPLabel" runat="server" Text='<%# Eval("HADICAP") %>' />
<br />
피도로:
<asp:Label ID="TIREDNESSLabel" runat="server" Text='<%# Eval("TIREDNESS") %>' />
<br />
경험치:
<asp:Label ID="EXP_TO_NEXT_LEVELLabel" runat="server"
 Text='<%# Eval("EXP_TO_NEXT_LEVEL") %>' />
<br />
평균 샷:
<asp:Label ID="AVG_SHOTSLabel" runat="server" Text='<%# Eval("AVG_SHOTS") %>' />
<br />
평균 퍼팅수:
<asp:Label ID="AVG_PUTSLabel" runat="server" Text='<%# Eval("AVG_PUTS") %>' />
<br />
최근 평균 핸디:
<asp:Label ID="RECENT_AVG_HANDILabel" runat="server"
 Text='<%# Eval("RECENT_AVG_HANDI") %>' />
<br />
홀인원 횟수:
<asp:Label ID="HOLE_IN_ONE_QTYLabel" runat="server"
 Text='<%# Eval("HOLE_IN_ONE_QTY") %>' />
<br />
최대 비거리:
<asp:Label ID="MAX_DISTANCELabel" runat="server"
 Text='<%# Eval("MAX_DISTANCE") %>' />
<br />
<asp:Label ID="NG_AMOUNTLabel" runat="server" Text='<%# Eval("NG_AMOUNT") %>' Visible="FALSE" />
<br />
최대 보유 아이템 수량:
<asp:Label ID="MAX_INVENTORY_QTYLabel" runat="server"
 Text='<%# Eval("MAX_INVENTORY_QTY") %>' />
<br />
경험치:
<asp:Label ID="EXPERIENCELabel" runat="server"
 Text='<%# Eval("EXPERIENCE") %>' />
<br />
모델:
<asp:Label ID="MODEL_IDLabel" runat="server" Text='<%# Eval("MODEL_ID") %>' />
<asp:Label ID="SERVER_NOLabel" runat="server" Text='<%# Eval("SERVER_NO") %>' Visible="FALSE" />
<asp:Label ID="ACCOUNT_IDLabel" runat="server" Text='<%# Eval("ACCOUNT_ID") %>' Visible="FALSE" />
<br />
타이틀:
<asp:Label ID="TITLE_NOLabel" runat="server" Text='<%# Eval("TITLE_NO") %>' />
<br />
</ItemTemplate>
</asp:DataList>
<asp:SqlDataSource ID="SqlDataSource3" runat="server"
 ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
 ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>"
 
                SelectCommand="SELECT * FROM &quot;CHARACTER&quot; WHERE ((&quot;SERVER_NO&quot; = :SERVER_NO) AND (&quot;CHARACTER_NAME&quot; = :CHARACTER_NAME))">
<SelectParameters>
<asp:SessionParameter Name="SERVER_NO" SessionField="SERVER" Type="Decimal" />
<asp:SessionParameter Name="CHARACTER_NAME" SessionField="CHARACTER_NAME"
 Type="String" />
</SelectParameters>
</asp:SqlDataSource>
        <br />
    
    </div>
    </form>
</body>
</html>
